
from DjangoDemo.scripts.Http_Management import Http_Management
from DjangoDemo.scripts.SiteID import Sites
from DjangoDemo.scripts.Token import Token


class EquipmentsLocation:
    # 默认深圳
    def __init__(self, site_name):

        self.site_name = Sites.get_mac(site_name)
        self.token = Token()
        # 定义接口的 URI
        GET_JOURNEY_URI = "/rest/campusrtlsservice/v1/rtls-map"
        # 配置 URL 和 Headers
        param = '''{
          "siteId":"857b706e-67d9-49c0-b3cd-4bd1e6963c07",
          "mapId":"540d8574-a743-4cda-a47e-3718b6a4f722",
          "startTime":"1623906000000",
          "endTime":"1623906000000"
        }'''

        self.r = Http_Management(self.token).get(GET_JOURNEY_URI, param)

if __name__ == '__main__':
    now = EquipmentsLocation("Shenzhen")
    print(now.r.json())